package com.ruoyi.system.controller;

import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.domain.request.UserRequest;
import com.ruoyi.system.service.LoginService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;


/**
 * @author 姚炜琦
 * @Classname LoginController
 * @Description TODO
 * @Date 2022/10/21 9:17
 */
@Controller
@RequestMapping("/loginClient")
@Log4j2
public class LoginController {
    @Autowired
    private LoginService loginService;

    @Autowired
    private HttpServletRequest request;

    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 去登录注册页面
     * @param model
     * @return
     */
    @RequestMapping(value = "/userLogin.html")
    public String loginAndRegistration(Model model){
        //http://127.0.0.1:6666/loginClient/userLogin.html
        return "userLogin";
    }

    /**
     * 去登录页面
     * @param model
     * @return
     */
    @RequestMapping(value = "/login.html")
    public String toLogin(Model model){
        //http://127.0.0.1:6666/loginClient/login.html
        return "login";
    }

    /**
     * 去注册页面
     * @param model
     * @return
     */
    @RequestMapping(value = "/registration.html")
    public String toRegistration(Model model){
        //http://127.0.0.1:6666/loginClient/registration.html
        return "registration";
    }

}
